package com.wolfalpha.lwtool.activity;

import com.wolfalpha.lwtool.R;
import com.wolfalpha.lwtool.constant.Application;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;
import android.widget.Toast;

public class InfoActivity extends Activity implements OnClickListener{

	private TextView json;
	private String data = "null";
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_info);
		//设置当前活动状态
		Application.setFrontActivity(Application.N_INFO);
		
		Intent intent = this.getIntent();
		Bundle bundle = intent.getExtras();
		if(bundle!=null&&bundle.containsKey("json")){
			data = bundle.getString("json");
		}
		
		initView();
		initListeners();
	}

	private void initListeners() {
		json.setOnClickListener(this);
	}

	private void initView() {
		json = (TextView) findViewById(R.id.json_data);
		json.setText(data);
	}

	@Override
	public void onClick(View arg0) {
		if(arg0.getId() == R.id.json_data){
			Toast.makeText(InfoActivity.this, "你点击了文本", Toast.LENGTH_SHORT).show();
		}
	}
}
